home *** CD-ROM | disk | FTP | other *** search
/ Delphi Developer's Kit 1996 / Delphi Developer's Kit 1996.iso / power / acc_obj0 / t_egw_0a.dpr < prev    next >
Encoding:
Text File  |  1995-12-22  |  1.2 KB  |  37 lines

  1. PROGRAM T_EGW_0a;
  2.  
  3. { PGM FOR DEMONSTRATING THE tBuf123Reader ACCESS OBJECT }
  4.  
  5. { This programs reads an AutoCAD DXF text file with an access object
  6.   of tBufTextFileReader class and then with one of the
  7.   tBufTextStringFileReader class.
  8.  
  9. { Pgm. 07/19/95 by John F Herbster for CIS Delphi Object Pascal Lib. }
  10.  
  11. {-----} USES {---------------------------------------------------------}
  12.   U_EGB_0a in 'U_EGB_0A.PAS',
  13.   SysUtils,
  14.   WinCrt;
  15.  
  16. VAR
  17.   Scanner: tBuf123RecScanner;
  18.   pRec: pByteArray; LghRec,TypeRec: word;
  19.  
  20. {=====} BEGIN {========================================================}
  21.  
  22.   Writeln('Using tBuf123RecReader as a tBufferedFileReader');
  23. { Create an instance of the class which openes the file and allocates
  24.   a buffer.  Note that the "Reader" is of the abstract class.  }
  25.   Scanner:=tBuf123RecScanner.Create('TEST.WK1',1024,50);
  26. { As long as LocNextRec function method can find a next record
  27.   keep doing the loop. }
  28.   With Scanner do while LocNextRec(TypeRec,LghRec,pRec) do begin
  29.     WriteLn(TypeRec:5,' ',LghRec:5);
  30.     end;
  31. { Return the buffer back to the system.}
  32.   Dispose(Scanner,Destroy);
  33.   WriteLn('Finished');
  34.  
  35. {=====} END. {=========================================================}
  36.  
  37.